<input type="hidden" name="CSRFToken" value="${CSRFToken!""}"/>
<table width="100%" class="dj-form-smart copy">
    <colgroup>
        <col width="280">
        <col width="*">
    </colgroup>
    <tbody>
    <tr>
        <th><em>*</em>姓名:</th>
        <td class="input">
            <input type="text" autocomplete="off" id="employer-input" reg="^([\u4e00-\u9fa5]){2,5}$" maxlength="5" ajaxreg="name:namecallback" ajaxcheck="true" class="text J_checkInput1" name="name" reg="name" maxlength="40" value="${(basic.name)!}">
            <em class="sync"></em>
            <div style="display:none;" class="error">请填写真实姓名，2-5个汉字</div>
        </td>
    </tr>
    <tr>
        <th><em>*</em>性别:</th>
        <td>
        <#list dictMap.DICT_GENDER.data as item>
            <input type="radio" name="gender" class="radio" value="${item.id?c}"<#if basic.gender?? && basic.gender==item.id> checked="checked"</#if>/><label class="radio" <#if item.id == 1>style="margin-right:15px;"</#if> for="gender${item.id?c}">${item.name}</label>
        </#list>
            <em class="sync"></em>
        </td>
    </tr>
    <tr>
        <th><em>*</em>现居地:</th>
        <td id="livecity-linkup">
        <#assign livecityParentId = 0 />
        <#assign livecityId = 0 />
        <#if basic.livecity??>
            <#assign livecityParentId = (dictMap.DICT_CITY.map.get(basic.livecity).parentId)!0 />
            <#assign livecityId = basic.livecity />
        </#if>
            <select class="city J_checkInput1">
                <option value="">请选择</option>
            <#list dictMap.DICT_CITY.data as item>
                <#if item.id lt 910000>
                    <option value="${item.id?c}"<#if livecityParentId==item.id || livecityId==item.id> selected</#if>>${item.name}</option>
                </#if>
            </#list>
            </select>
            <select id="basic-livecity-select" name="livecity" class="city J_checkInput1">
            <#if livecityId!=0 && dictMap.DICT_CITY.map.get(livecityId)??>
                <#if livecityParentId!=0>
                    <#assign itemList = dictMap.DICT_CITY.map.get(livecityParentId).children />
                <#else>
                    <#assign itemList = dictMap.DICT_CITY.map.get(livecityId).children />
                </#if>
                <#if itemList?size==0>
                    <option value="${livecityId}">${dictMap.DICT_CITY.map.get(livecityId).name}</option>
                <#else>
                    <#list itemList as item>
                        <option value="${item.id?c}"<#if livecityId == item.id> selected</#if>>${item.name}</option>
                    </#list>
                </#if>
            </#if>
            </select>
        <@holder>
            <script type="text/javascript">
                $('#livecity-linkup').linkup({type: 'city'});
            </script>
        </@holder>
            <em class="sync"></em>
            <div style="display:none;" class="error">请选目前居住地</div>
        </td>
    </tr>
    <tr>
        <th><em>*</em>户口地:</th>
        <td class="input" id="domicile-linkup">
        <#assign domicileParentId = 0 />
        <#assign domicileId = 0 />
        <#if basic.domicile??>
            <#assign domicileParentId = (dictMap.DICT_CITY.map.get(basic.domicile).parentId)!0 />
            <#assign domicileId = basic.domicile />
        </#if>
            <select class="city J_checkInput1">
                <option value="">请选择</option>
            <#list dictMap.DICT_CITY.data as item>
                <#if item.id lt 910000>
                    <option value="${item.id?c}"<#if domicileParentId==item.id || domicileId==item.id> selected</#if>>${item.name}</option>
                </#if>
            </#list>
            </select>
            <select id="basic-domicile-select" name="domicile" class="city J_checkInput1">
            <#if domicileId!=0>
                <#if domicileParentId!=0>
                    <#assign itemList = (dictMap.DICT_CITY.map.get(domicileParentId).children)! />
                <#else>
                    <#assign itemList = (dictMap.DICT_CITY.map.get(domicileId).children)! />
                </#if>
                <#if !itemList?? || itemList?size==0>
                    <#if (domicileId)?? &&(dictMap.DICT_CITY.map)?? && (dictMap.DICT_CITY.map.get(domicileId))??>
                        <option value="${domicileId}">${dictMap.DICT_CITY.map.get(domicileId).name}</option>
                    </#if>
                <#else>
                    <#list itemList as item>
                        <option value="${item.id?c}"<#if domicileId == item.id> selected</#if>>${item.name}</option>
                    </#list>
                </#if>
            </#if>
            </select>
        <@holder>
            <script type="text/javascript">
                $('#domicile-linkup').linkup({type: 'city'});
            </script>
        </@holder>
            <div style="display:none;" class="error">请选择户口所在地区</div>
        </td>
    </tr>
    <tr>
        <th><em>*</em>出生日期:</th>
        <td class="input">
        <#assign startyear=currentDate?string('yyyy')?number?int-53 />
        <#assign endyear=currentDate?string('yyyy')?number?int-16 />
        <@dateinput name="birthday" id="profile-birthdate-input" startyear=startyear endyear=endyear value=(basic.birthday?string("yyyy-MM-dd"))! class="J_checkInput1"/>
            <div style="display: none; " class="error">请选择出生日期</div>
        </td>
    </tr>
    <tr>
        <th><#if navStatus?? && navStatus ==1><em>*</em></#if>工作经验:</th>
    <#if basic.workStartYear??>
        <#assign wYear = currentDate?string('yyyy')?number?int - basic.workStartYear>
    </#if>
        <td class="input">
            <select name="workYear" id="work-start-year-input" <#if navStatus?? && navStatus ==1>class="J_checkInput1"</#if> style="width:204px;">
                <option value="">请选择</option>
                <option <#if wYear?? && wYear lte 0>selected="selected" </#if> value="1">刚参加工作</option>
                <option <#if wYear?? && wYear == 1>selected="selected" </#if> value="2">已工作1年</option>
                <option <#if wYear?? && wYear == 2>selected="selected" </#if> value="3">已工作2年</option>
                <option <#if wYear?? && wYear == 3>selected="selected" </#if> value="4">已工作3年</option>
                <option <#if wYear?? && wYear == 4>selected="selected" </#if> value="5">已工作4年</option>
                <option <#if wYear?? && wYear == 5>selected="selected" </#if> value="6">已工作5年</option>
                <option <#if wYear?? && wYear == 6>selected="selected" </#if> value="7">已工作6年</option>
                <option <#if wYear?? && wYear == 7>selected="selected" </#if> value="8">已工作7年</option>
                <option <#if wYear?? && wYear gt 7>selected="selected" </#if> value="9">8年及以上</option>
            </select>
            <div style="display: none; " class="error">请选择工作经验</div>
        </td>
    </tr>
    <tr>
        <th><em>*</em>手机:</th>
        <td class="input">
            <input type="hidden" id="mobile-auth" value="${authedMobile!}">
            <input type="text" blankclass="g" blankvalue="0086" blanksubmit="true" class="text J_checkInput1 g" name="mobZipcode" maxlength="7" value="${(basic.mobZipcode)!""}" style="width:50px;" id="mobileZipcode"> -
            <input type="text" class="text J_checkInput1" name="mob" maxlength="20" value="${(basic.mob)!}" style="width:172px;" reg="fun:mobile" id="mobile">
            <em class="sync"></em>
            <div style="display:none;" class="error">请输入正确的手机号码</div>
        </td>
    </tr>
    <tr class="last-tr">
        <th ><em>*</em>邮箱:</th>
        <td class="input" >
            <input type="text" reg="email" class="text J_checkInput1" name="email" maxlength="50" value="${(basic.email)!}" id="emailInput">
            <em class="sync"></em>
            <div style="display: none; " class="error"> 请正确填写邮箱</div>
        </td>
    </tr>
    <tr>
        <th>&nbsp;</th>
        <td class="sync-info"><span class="f12">标识 </span><em class="sync"></em><span class="f12"> 的信息将会同步到“我的档案中”</span></td>
    </tr>
    <tr>
        <th>&nbsp;</th>
        <td class="input button">
            <a href="javascript:void(0);" class="big-fresh basicValidate margin" id="J_formSubmit1"><span><#if nextBtn?? && nextBtn=="done">完成<#else >下一步</#if></span></a>
        <#if resumeCreate?? && resumeCreate>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/resume/generate/profile" class="f12 t-color" id="J_formCancel">返回上一步</a></#if>
        </td>
    </tr>
    </tbody>
</table>
<input type="hidden" name="nav" value="${navStatus!}">
<input type="hidden" name="method" value="do">
<input type="hidden" name="from" value="resume">

<script type="text/javascript">
    function namecallback(r){
        if(r == false){
            $(this).parents('td').find('.error').show()
        }
    }
    $(function() {
        //$.formValidate.ajaxtype['name']='/resume/basic/name/blackCheck';
        $.formValidate.ajaxtype['name']='/invitation/saveResume';
        var $checks = $('.J_checkInput1'),
                $btnO = $('#J_formSubmit1'),
                flag = true;
        $checks.formValidate({button:'basicValidate'});
        $checks.focus(function () {
            $(this).parents('td').find('.error').hide();
        });
        $('.text').focus(function(){
            $(this).parents('td').find('.error').hide();
        });

        $btnO.click(function (e) {
            e.preventDefault();
            $checks.each(function () {
                var e = $.formValidate.check('basicValidate',this);
                if (!e) {
                    $(this).parents('td').find('.error').show();
                }
            });
            $.formValidate.submit('basicValidate', function(r){
                if(r) {
                CALLBACK();
                }
            })
        });
    });

    $(function(){
        var $mobile = $('#mobile');
        var $code =     $('#mobileZipcode');
        var $auth = $('#mobile-auth');
        var auth = $auth.val();
        var validatePhone = new G_ValidatePhone({
            type : 'job',
            token : '',
            num_self : 'e' + '${upSmsCode}',
            callback : function(args){
                var phoneNum = args.phoneNum;
                var status = args.status; // 0成功 , 1失败
                if(status == 0){
                    $mobile.val(phoneNum);
                    $auth.val(phoneNum);
                    auth = phoneNum;
                }
            }
        });
        $code.blur(function(){
            $mobile.blur();
        });
        $mobile.bind('blur', function(){
            var val = $mobile.val();
            if($.formValidate.check('basicValidate',$mobile[0]) && val != auth && $code.val() == '0086'){
                validatePhone.openDialog(val);
            }
        });
    })

</script>